@ GNU AS assembler header file for Filer
@ Written by DefMod (Dec  9 2012) on Sun Dec  9 15:47:15 2012
@ Jonathan Coxhead, jonathan@doves.demon.co.uk, 23 June 1995

@ OSLib---efficient, type-safe, transparent, extensible,
@ register-safe API coverage of RISC OS
@ 
@ Copyright (c) 1994-2012 Jonathan Coxhead and OSLib maintainers
@ 
@ Licence:
@ 
@    OSLib is free software; you can redistribute it and/or modify
@ it under the terms of the GNU General Public License as published by
@ the Free Software Foundation; either version 1, or (at your option)
@ any later version - and this with the following clarification and
@ special exception:
@ 
@    Linking this library statically or dynamically with other modules
@ is making a combined work based on this library. Thus, the terms
@ and conditions of the GNU General Public License cover the whole
@ combination.
@ 
@    As a special exception, the copyright holders of this library
@ give you permission to link this library with independent modules
@ to produce an executable, regardless of the license terms of these
@ independent modules, and to copy and distribute the resulting
@ executable under terms of your choice, provided that you also meet,
@ for each linked independent module, the terms and conditions of the
@ license of that module. An independent module is a module which is
@ not derived from or based on this library. If you modify this
@ library, you may extend this exception to your version of the library,
@ but you are not obliged to do so. If you do not wish to do so, delete
@ this exception statement from your version.
@ 
@    OSLib is distributed in the hope that it will be useful,
@ but WITHOUT ANY WARRANTY; without even the implied warranty of
@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@ GNU General Public License for more details.
@ 
@    You should have received a copy of the GNU General Public License
@ along with this programme; if not, write to the Free Software
@ Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, USA.

#ifndef Filer_Hdr
#  define Filer_Hdr

#  ifndef Get_Types
#    define Get_Types
#    include "oslib/Types.Hdr"
#  endif

#  ifndef Get_OS
#    define Get_OS
#    include "oslib/OS.Hdr"
#  endif

#  ifndef Get_Wimp
#    define Get_Wimp
#    include "oslib/Wimp.Hdr"
#  endif

#  ifndef Get_FileSwitch
#    define Get_FileSwitch
#    include "oslib/FileSwitch.Hdr"
#  endif

#  ifndef Get_FilerAction
#    define Get_FilerAction
#    include "oslib/FilerAction.Hdr"
#  endif

@Symbols for constants
#  define Error_FilerNoRecursion 0xb80
#  define Error_FilerNoTemplate 0xb81
#  define Error_FilerFailedSave 0xb82
#  define Error_FilerBadPath 0xb83
#  define Message_FilerOpenDir 0x400
#  define Message_FilerCloseDir 0x401
#  define Message_FilerOpenDirAt 0x402
#  define Message_FilerSelectionDir 0x403
#  define Message_FilerAddSelection 0x404
#  define Message_FilerAction 0x405
#  define Message_FilerControlAction 0x406
#  define Message_FilerSelection 0x407
#  define Message_FilerDeviceDir 0x408
#  define Filer_FormatNative 0x1
#  define Filer_DirNoncanonical 0x1
#  define Filer_DisplayLargeIcons 0x0
#  define Filer_DisplaySmallIcons 0x1
#  define Filer_DisplayFullInfo 0x2
#  define Filer_Display 0x3
#  define Filer_DisplayShift 0x0
#  define Filer_SortByName 0x0
#  define Filer_SortBySize 0x1
#  define Filer_SortByType 0x2
#  define Filer_SortByDate 0x3
#  define Filer_Sort 0xc
#  define Filer_SortShift 0x2
#  define Filer_GivenDisplay 0x10
#  define Filer_GivenSort 0x20
#  define Filer_ControlAcknowledge 0x0
#  define Filer_ControlVerboseOn 0x1
#  define Filer_ControlVerboseOff 0x2

@Symbols for structure offsets and sizes
        .struct 0
        .skip   Int
Filer_Control                  : 

        .struct 0
Filer_MessageOpenDir_fs_no     : .skip   FileSwitch_FSNo
Filer_MessageOpenDir_reserved  : .skip   3*Byte
Filer_MessageOpenDir_flags     : .skip   Bits
Filer_MessageOpenDir_dir_name  : .skip   228*Char
Filer_MessageOpenDir           : 

        .struct 0
Filer_MessageOpenDirAt_fs_no   : .skip   FileSwitch_FSNo
Filer_MessageOpenDirAt_reserved: .skip   3*Byte
Filer_MessageOpenDirAt_flags   : .skip   Bits
Filer_MessageOpenDirAt_at      : .skip   OS_Coord
Filer_MessageOpenDirAt_width   : .skip   Int
Filer_MessageOpenDirAt_height  : .skip   Int
Filer_MessageOpenDirAt_display : .skip   Byte
Filer_MessageOpenDirAt_dir_name: .skip   211*Char
Filer_MessageOpenDirAt         : 

        .struct 0
Filer_MessageSelectionDir_dir_name: .skip   236*Char
Filer_MessageSelectionDir      : 

        .struct 0
Filer_MessageAddSelection_leaf_list: .skip   236*Char
Filer_MessageAddSelection      : 

        .struct 0
Filer_MessageAction_operation  : .skip   FilerAction_Operation
Filer_MessageAction_options    : .skip   FilerAction_Flags
Filer_MessageAction_data       : 
Filer_MessageAction_data_destination_dir_name: .skip   228*Char
        .struct Filer_MessageAction_data
Filer_MessageAction_data_access_access: .skip   Short
Filer_MessageAction_data_access_mask: .skip   Short
        .struct Filer_MessageAction_data
Filer_MessageAction_data_file_type: .skip   Bits
        .struct Filer_MessageAction_data
Filer_MessageAction_data_find_leaf: .skip   228*Char
Filer_MessageAction            : 

        .struct 0
Filer_MessageControlAction_control: .skip   Filer_Control
Filer_MessageControlAction     : 

        .struct 0
Filer_MessageSelection_bbox    : .skip   OS_Box
Filer_MessageSelection_width   : .skip   Int
Filer_MessageSelection_height  : .skip   Int
Filer_MessageSelection_display : .skip   Bits
Filer_MessageSelection_col0    : .skip   Int
Filer_MessageSelection_row0    : .skip   Int
Filer_MessageSelection_col1    : .skip   Int
Filer_MessageSelection_row1    : .skip   Int
Filer_MessageSelection         : 

        .struct 0
Filer_MessageDeviceDir_path_name: .skip   236*Char
Filer_MessageDeviceDir         : 

        .struct 0
        Wimp_MessageHeader_MEMBERS Filer_FullMessageOpenDir
Filer_FullMessageOpenDir_fs_no : .skip   FileSwitch_FSNo
Filer_FullMessageOpenDir_reserved: .skip   3*Byte
Filer_FullMessageOpenDir_flags : .skip   Bits
Filer_FullMessageOpenDir_dir_name: .skip   228*Char
Filer_FullMessageOpenDir       : 

        .struct 0
        Wimp_MessageHeader_MEMBERS Filer_FullMessageOpenDirAt
Filer_FullMessageOpenDirAt_fs_no: .skip   FileSwitch_FSNo
Filer_FullMessageOpenDirAt_reserved: .skip   3*Byte
Filer_FullMessageOpenDirAt_flags: .skip   Bits
Filer_FullMessageOpenDirAt_at  : .skip   OS_Coord
Filer_FullMessageOpenDirAt_width: .skip   Int
Filer_FullMessageOpenDirAt_height: .skip   Int
Filer_FullMessageOpenDirAt_display: .skip   Byte
Filer_FullMessageOpenDirAt_dir_name: .skip   211*Char
Filer_FullMessageOpenDirAt     : 

        .struct 0
        Wimp_MessageHeader_MEMBERS Filer_FullMessageSelectionDir
Filer_FullMessageSelectionDir_dir_name: .skip   236*Char
Filer_FullMessageSelectionDir  : 

        .struct 0
        Wimp_MessageHeader_MEMBERS Filer_FullMessageAddSelection
Filer_FullMessageAddSelection_leaf_list: .skip   236*Char
Filer_FullMessageAddSelection  : 

        .struct 0
        Wimp_MessageHeader_MEMBERS Filer_FullMessageAction
Filer_FullMessageAction_operation: .skip   FilerAction_Operation
Filer_FullMessageAction_options: .skip   FilerAction_Flags
Filer_FullMessageAction_data   : 
Filer_FullMessageAction_data_destination_dir_name: .skip   228*Char
        .struct Filer_FullMessageAction_data
Filer_FullMessageAction_data_access_access: .skip   Short
Filer_FullMessageAction_data_access_mask: .skip   Short
        .struct Filer_FullMessageAction_data
Filer_FullMessageAction_data_file_type: .skip   Bits
        .struct Filer_FullMessageAction_data
Filer_FullMessageAction_data_find_leaf: .skip   228*Char
Filer_FullMessageAction        : 

        .struct 0
        Wimp_MessageHeader_MEMBERS Filer_FullMessageControlAction
Filer_FullMessageControlAction_control: .skip   Filer_Control
Filer_FullMessageControlAction : 

        .struct 0
        Wimp_MessageHeader_MEMBERS Filer_FullMessageSelection
Filer_FullMessageSelection_bbox: .skip   OS_Box
Filer_FullMessageSelection_width: .skip   Int
Filer_FullMessageSelection_height: .skip   Int
Filer_FullMessageSelection_display: .skip   Bits
Filer_FullMessageSelection_col0: .skip   Int
Filer_FullMessageSelection_row0: .skip   Int
Filer_FullMessageSelection_col1: .skip   Int
Filer_FullMessageSelection_row1: .skip   Int
Filer_FullMessageSelection     : 

        .struct 0
        Wimp_MessageHeader_MEMBERS Filer_FullMessageDeviceDir
Filer_FullMessageDeviceDir_path_name: .skip   236*Char
Filer_FullMessageDeviceDir     : 

        .struct 0
Filer_Format_next              : .skip   Ptr
Filer_Format_menu_text         : .skip   Ptr
Filer_Format_help_text         : .skip   Ptr
Filer_Format_disc_format_swi   : .skip   Int
Filer_Format_disc_format_handle: .skip   Int
Filer_Format_layout_structure_swi: .skip   Int
Filer_Format_layout_structure_handle: .skip   Int
Filer_Format_flags             : .skip   Bits
Filer_Format                   : 


@Symbols for SWI's and SWI reason codes
#  define Service_StartFiler 0x4b
   @Entry
   @  R0 = task (Wimp_T)
   @  R1 = &4B
   @Exit
   @  R0 -> command (String)
   @  R1 = unclaimed (Bool)

#  define Service_StartedFiler 0x4c
   @Entry
   @  R1 = &4C

#  define Service_FilerDying 0x4f
   @Entry
   @  R1 = &4F

#  define Service_EnumerateFormats 0x6a
   @Entry
   @  R1 = &6A
   @  R2 = format_list (pointer to Filer_Format)
   @Exit
   @  R2 = format_list_out (pointer to Filer_Format)

#  define Service_DiscDismounted 0x7d
   @Entry
   @  R1 = &7D
   @  R2 -> disc_name (String)

#endif
